bitkeeper revision 1.268 (3f0559790jS_a4S9XzxupGBulKlRxQ)
authorrac61@labyrinth.cl.cam.ac.uk <rac61@labyrinth.cl.cam.ac.uk>
Fri, 4 Jul 2003 10:39:53 +0000 (10:39 +0000)
committerrac61@labyrinth.cl.cam.ac.uk <rac61@labyrinth.cl.cam.ac.uk>
Fri, 4 Jul 2003 10:39:53 +0000 (10:39 +0000)
Parse read/write mode in xi_phys_probe so that front-end doesn't need to know what the mode bits mean.

tools/internal/xi_phys_probe.c

index 1c64980cfa62b94da813bf5595892f2c63c5ad7e..aa260145c72b87e6d28757972586141e99536eec 100644 (file)
@@ -35,10 +35,13 @@ int main(int argc, char *argv[])
       break;
 
     for (x = 0; x < buf.n_aces; x++) {
-      printf("%x %x %x %x\n", buf.entries[x].device,
+      char read = ( buf.entries[x].mode & 1 ? 'r' : ' ' );
+      char write = ( buf.entries[x].mode & 2 ? 'w' : ' ' );
+      printf("%x %x %x %c%c\n", buf.entries[x].device,
             buf.entries[x].start_sect,
             buf.entries[x].n_sectors,
-            buf.entries[x].mode);
+            read,
+            write);
     }
     buf.start_ind += buf.n_aces;
   } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST);